<template>
<div>
  <h1>torefs-demo {{name}} {{age}}</h1>
  <!-- <h2>toRef  {{toRefAge}}</h2> -->
</div>
</template>

<script>
import { ref, toRefs, reactive} from 'vue'
export default {
  name: 'toRef',
  setup() {
    const state = reactive({
      age: 18,
      name: 'xueguo'
    })

    
    const {age, name } = toRefs(state)
    setTimeout(() => {
      state.age = 20
    }, 1500)
    return {
      age,
      name
    }
  }
}
</script>

<style>

</style>